package com.nexus.service.sys.service.mapstruct;

import com.nexus.core.service.mapstruct.BaseConverter;
import com.nexus.core.sys.dto.SysDictValueDTO;
import com.nexus.core.sys.entity.SysDictValue;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * SysDictValueWrapper
 *
 * @author 路正宁
 * @version 2023-03-15
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
public interface SysDictValueWrapper extends BaseConverter<SysDictValue, SysDictValueDTO> {

    SysDictValueWrapper INSTANCE = Mappers.getMapper(SysDictValueWrapper.class);

    @Mappings({
            @Mapping(source = "dictType.id", target = "dictType"),
            @Mapping(source = "createBy.id", target = "createBy"),
            @Mapping(source = "updateBy.id", target = "updateBy")})
    SysDictValue toEntity(SysDictValueDTO dto);


    @Mappings({
            @Mapping(source = "dictType", target = "dictType.id"),
            @Mapping(source = "createBy", target = "createBy.id"),
            @Mapping(source = "updateBy", target = "updateBy.id")})
    SysDictValueDTO toDTO(SysDictValue entity);

}

